//package com.hmall.gateway.Filter;
//
//import lombok.Data;
//import org.springframework.cloud.gateway.filter.GatewayFilter;
//import org.springframework.cloud.gateway.filter.GatewayFilterChain;
//import org.springframework.cloud.gateway.filter.OrderedGatewayFilter;
//import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory;
//import org.springframework.stereotype.Component;
//import org.springframework.web.server.ServerWebExchange;
//import reactor.core.publisher.Mono;
//
//import java.util.List;
//
//@Component
//public class PrintAnyGatewayFilterFactory extends AbstractGatewayFilterFactory<PrintAnyGatewayFilterFactory.Config> {
//             //过滤器名称必须以GatewayFilterFactory结尾，否则不会被Spring Cloud Gateway扫描到
//             //前面的对应yaml配置
//    @Override
//    public GatewayFilter apply(PrintAnyGatewayFilterFactory.Config config) {
//        return new OrderedGatewayFilter(new GatewayFilter() {
//            @Override
//            public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
//                //编写过滤器逻辑
//                String a = config.getA();
//                String b = config.getB();
//                String c = config.getC();
//                System.out.println("a: " + a+", b: "+b+", c: "+c);
//                System.out.println("PrintAnyGatewayFilterFactory");
//                return chain.filter(exchange);
//            }
//        },1) {
//        };
//    }
//    //自定义配置属性，成员名称和下面的对应
//    @Data
//    public static class Config {
//        private String a;
//        private String b;
//        private String c;
//    }
//    //循序也要和上面的对应
//    @Override
//    public List<String> shortcutFieldOrder() {
//        return List.of("a", "b", "c");
//    }
//    //将Config的字节码传给父类，父类负责读取yaml的配置
//    public PrintAnyGatewayFilterFactory() {
//        super(Config.class);
//    }
//}
